// 导入封装的 axios
import type { CategoryList, ICateBrand, IHotList, INewGoods, ISlider, ProductList } from '@/types/api/home'
import { http } from '@/utils/request'

// 获取头部导航
export const findAllCategory = () => {
  return http<CategoryList>('get', '/home/category/head')
}

// 品牌数据
export const findBrand = (limit: number) => {
  return http<ICateBrand[]>('get', '/home/brand', { limit })
}

// 获取轮播图
export const findBanner = () => {
  return http<ISlider[]>('get', '/home/banner')
}

// 获取新鲜好物数据
export const findNew = () => {
  return http<INewGoods[]>('get', '/home/new')
}

// 人气推荐
export const findHot = () => {
  return http<IHotList[]>('get', 'home/hot')
}

// 获取商品板块
export const findGoods = () => {
  return http<ProductList>('get', '/home/goods')
}

// 获取最新专题
export const findSpecial = () => {
  return http('get', '/home/special')
}
